﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IPageable<ReportsOverviewModel>>" %>
<%@ Import Namespace="DR.WebUI.Models.Manager" %>
<%@ Import Namespace="DR.WebUI.Models.Enums" %>
<%@ Import Namespace="DR.WebUI.Models.Common" %>


<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Developers Reports
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h3>Reports</h3>
        <form method="post" action="SetupReportFilter">
            <div>
            <table>
                <tr>
                    <td><b>Reporting Period</b></td>
                    <td><b>Project</b></td>
                    <td><b>Developer</b></td>
                    <td><b>State</b></td>
                    <td rowspan="2" style="vertical-align:bottom">
                        <input type="submit" name="filterButton" value="Apply" />
                        <input type="submit" name="filterButton" value="Reset" />
                    </td>
                </tr>
                <tr>
                    <% ReportFilter filter = (ReportFilter)ViewData["ReportFilter"]; %>
                    <td>                    
                        <%: Html.DropDownList("reportingPeriodID", (IList<SelectListItem>)ViewData["ReportingPeriods"])%>
                    </td>
                    <td>
                        <%: Html.DropDownList("projectID", (IList<SelectListItem>)ViewData["Projects"])%>
                    </td>
                    <td>
                        <%: Html.DropDownList("developerID", (IList<SelectListItem>)ViewData["Developers"])%>
                    </td>
                    <td>
                        <% foreach (FilterReportStatus item in (IList<FilterReportStatus>)ViewData["ReportStatuses"]) %>
                        <% { %>
                            <input type="checkbox" name="statuses" checked="checked" />
                            <%: item.Text %>
                        <% } %>
                    </td>
                </tr>
            </table> 
        </div>
        </form>
    <div id="tableStyle">
        <table style="width:100%;">
            <thead>
                <tr>
                    <th>Report ID</th>
                    <th>Project</th>
                    <th>Developer</th>
                    <th>Report Title</th>
                    <th>Create Date</th>
                    <th>Reported Date</th>
                    <th>Hours</th>
                    <th>State</th>
                </tr>
            </thead>
            <tbody>            
                <% foreach (ReportsOverviewModel r in Model.Page) %>
                <% { %>
                        <tr>
                            <td><%: r.ReportID %>
                        
                            </td>
                            <td><%: r.Project %></td>
                            <td><%: r.Developer %></td>
                            <td><%: r.ReportTitle %></td>
                            <td><%: r.DateCreate %></td>
                            <td><%: r.DateReporting %></td>
                            <td><%: r.Hours %></td>
                            <td><%: r.State %></td>     
                            <td style="width:60px;">
                            
                                <% if (r.State != ReportStatus.Approved) %>
                                <% {%>
                                        <div>
                                            <%: Html.Hidden("ReportID_" + r.ReportID, r.ReportID, new { @class = "report-id" })%>
                                            <div class="status" title="Confirm"></div>
                                            <div class="delete" title="Reject"></div>
                                        </div>
                                <% }%>
                            </td>                        
                        </tr>        
                <% } %>
            </tbody>
        </table>
    </div>
    <div>
        <%=Html.Pagination() %>
    </div>

</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="headPlaceHolder" runat="server">    

    <script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-1.4.4.min.js")%>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery-ui-1.8.7.custom.min.js")%>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/Report/modal-approve-project.js")%>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/Report/modal-reject-project.js")%>"></script>

    <link type="text/css" href="/Content/jquery/jquery-ui-1.8.7.custom.css" rel="stylesheet" />
    <link type="text/css" href="/Content/css/Awesome.css" rel="stylesheet"  />

    <script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery.form.js")%>"></script>
    <script type="text/javascript" src="<%= Url.Content("~/Scripts/Awesome.js")%>"></script>

</asp:Content>
